<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title>Vue示例</title>

</head>

<body>
<div id="app1">

</div>
<div id="app2">
    {{reversedText}}
</div>
<script charset="utf-8" src="../js/vue.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var app1 = new Vue({
        el: '#app1',
        data: {
            text: '123,456'
        }
    });

    var app2 = new Vue({
        el: '#app2',
        computed: {
            reversedText: function () {
                // 这里依赖的是实例app1的数据text
                return app1.text.split(',').reverse().join(',');
            }
        }
    })
</script>
</body>

</html>
